package com.caijin.common.core.domain.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.caijin.common.core.domain.BaseEntity;
import com.caijin.common.core.domain.vo.CatalogueVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 课程目录表
 * </p>
 *
 * @author Peas
 * @since 2021-01-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tb_catalogue")
@ApiModel(value="Catalogue对象", description="课程目录表")
public class Catalogue extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "目录编号，主键，唯一标识，自增")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "标题")
    private String label;

    @ApiModelProperty(value = "父级id")
    private Long parentId;

    @ApiModelProperty(value = "所属课程编号")
    private Long cno;

    @ApiModelProperty(value = "文本内容")
    private String content;

    @ApiModelProperty(value = "bucket名称")
    private String bucket;

    @ApiModelProperty(value = "oss瀵瑰簲鐨勬枃浠秛rl")
    private String ossUrl;

    public CatalogueVO toVO(){
        CatalogueVO catalogueVO = new CatalogueVO();

        catalogueVO.setId(this.id);
        catalogueVO.setParentId(this.parentId);
        catalogueVO.setLabel(this.label);
        catalogueVO.setContent(this.content);

        return catalogueVO;
    }

}
